<form method="post" action="{url link='admincp.topcmmchat'}" id="admincp_chat_form">
<div class="table_header">
	Basic Settings
</div>

<div class="table">

 	{ if (!(function_exists("curl_init") || ini_get("allow_url_fopen")))}
	<div class="table_left" id='server_mode'>
		<b>Notice:</b><br/>
	</div>
	<div class="table_right">
		<font color="red">Please contact ISP if "CURL" or "allow_url_fopen" is enabed in PHP configuration.</font>
	</div>
	{ /if }
	<div class="clear"></div>

	<div class="table_left" id='server_mode'>
		<b>Chat Server Mode:</b><br/>
	</div>
	<div class="table_right">
		<p><input type="radio" name="fc_extendserver" id="s_mode_0" value="0" {if $c_loc == 0}onclick="onclick_server_mode(0,0)"{else}onclick="onclick_server_mode(0,1)"{/if} {if $settings.fc_extendserver==0}checked="checked"{/if}> Chat server hosted by your own<br/><span style="font-family: verdana,sans-serif;font-size: 0.85em;font-style: italic; color:gray;">Please download and install 123FlashChat first: <a href="http://www.123flashchat.com/download.html" target="_blank"> http://www.123flashchat.com/download.html</a>, 
			and set Chat Client Location to: http://&lt;your chat server domain or ip&gt;:35555/</span></p>
		<p><input type="radio" name="fc_extendserver" id="s_mode_1" value="1" {if $c_loc == 0}onclick="onclick_server_mode(1,0)"{else}onclick="onclick_server_mode(1,1)"{/if} {if $settings.fc_extendserver==1}checked="checked"{/if}> Chat server hosted by 123FlashChat<br/><span style="font-family: verdana,sans-serif;font-size: 0.85em;font-style: italic; color:gray;"><a href="http://www.123flashchat.com/host.html" target="_blank">For paid host</a>, please set the Chat Client Location like this, for example: http://host71200.123flashchat.com/wordpress/, <a href="http://www.123flashchat.com/host.html" target="_blank">Buy host</a>
			<a href="http://www.123flashchat.com/host/apply.php" target="_blank">For trial host</a>, please setup Chat Client Location like this: http://trial.123flashchat.com/yourhostname
			Just replace "yourhostname" to the real one when you applied, <a href="http://www.123flashchat.com/host/apply.php" target="_blank">Apply trial host</a></span></p>
		<p><input type="radio" name="fc_extendserver" id="s_mode_2" value="2" {if $c_loc == 0}onclick="onclick_server_mode(2,0)"{else}onclick="onclick_server_mode(2,1)"{/if} {if $settings.fc_extendserver==2}checked="checked"{/if}> Chat server hosted by 123flashchat free of charge<br /><span style="font-family: verdana,sans-serif;font-size: 0.85em;font-style: italic; color:gray;">This chat server mode aims at testing the basic functions, only supported 1 room, no video chat function, and also you don't have the administrator permission of entering this chat room, you can select the mode 1 or 2 to get the full functions and control your chat room.</span></p>
	</div>
	<div class="clear"></div>
</div>

<div class="table" id="s_download" {if $settings.fc_extendserver!=0}style="display: none"{/if}>
	<div class="table_left" {if $c_loc==0}style="display: none"{/if}>
		<b>NOTE:</b><br/>
	</div>
	<div class="table_right" {if $c_loc==0}style="display: none"{/if}>
		<span style="color:#ff0000"> Please install 123FlashChat Server first before enable this Mod.</span>
		<a href={$download} target="_blank">Free Download</a>
	</div>
	<div class="clear">
	</div>
</div>

<div class="table" id='login_chat' {if $settings.fc_extendserver==2}style="display: none"{/if}>
	<div class="table_left" >
		<b>Integration URL:</b><br/>
		To integrate users for auto-login to chat.
	</div>
	<div class="table_right">
		Please open the Chat Admin Panel, then System Settings > Integration Panel, set authentication URL to:<br/>
		<span style="color:#ff0000"> {$login_chat}</span>
	</div>
	<div class="clear">
	</div>
</div>

<div class="table" id='chat_host' {if $settings.fc_extendserver!=0}style="display: none"{/if}>

	<div class="table_left" {if $c_loc==0}style="display: none"{/if}>
		<b>Chat Server Host:</b>
	</div>
	<div class="table_right" {if $c_loc==0}style="display: none"{/if}>
		<input name="fc_server_host" id="s_host" size="60" value="{$settings.fc_server_host}"><br/>
	</div>
	<div class="clear"></div>
</div>
<div class="table" id='chat_port' {if $settings.fc_extendserver!=0}style="display: none"{/if}>
	<div class="table_left" {if $c_loc==0}style="display: none"{/if}>
		<b>Chat Server Port:</b>
	</div>
	<div class="table_right" {if $c_loc==0}style="display: none"{/if}>
		<input name="fc_server_port" id="s_port" size="30" value="{$settings.fc_server_port}"><br/>
	</div>
	<div class="clear"></div>
</div>
<div class="table" id='http_port' {if $settings.fc_extendserver!=0}style="display: none"{/if}>
	<div class="table_left" {if $c_loc==0}style="display: none"{/if}>
		<b>Chat Server HTTP Port:</b>
	</div>
	<div class="table_right" {if $c_loc==0}style="display: none"{/if}>
		<input name="fc_http_port" id="s_http_port" size="30" value="{$settings.fc_http_port}"><br/>
	</div>
	<div class="clear"></div>
</div>

<div class="table" id='client_location' {if $settings.fc_extendserver==2}style="display: none"{/if}>
	<div class="table_left">
		<b>Chat Client Location:</b>
	</div>
	<div class="table_right">
		<input name="fc_client_loc" id="c_location" size="60" value="{$settings.fc_client_loc}"><br/>
	</div>
	<div class="clear"></div>
</div>

<div class="table" id='room_name' {if $settings.fc_extendserver!=2}style="display: none"{/if}>
	<div class="table_left">
		<b>Chat Room Name:</b>
	</div>
	<div class="table_right">
		<input name="fc_room" id="r_name" size="20" value="{$settings.fc_room}"><br/>
	</div>
	<div class="clear"></div>
</div>
<div class="table" id='room_list' {if $settings.fc_extendserver==2 }style="display: none"{/if}>
	<div class="table_left">
		<b>Show Room List:</b>
	</div>
	<div class="table_right">
		<input class="radio" name="fc_room_list" id="r_list_0" value="1" type="radio" {if $settings.fc_room_list==1}checked="checked"{/if}>Yes
		<input class="radio" name="fc_room_list" id="r_list_1" value="0" type="radio" {if $settings.fc_room_list==0}checked="checked"{/if}> No
	</div>
	<div class="clear"></div>
</div>

<div class="table" id='user_list' >
	<div class="table_left">
		<b>Show User List:</b>
	</div>
	<div class="table_right">
		<input class="radio" name="fc_user_list" id="u_list_0" value="1" type="radio" {if $settings.fc_user_list==1}checked="checked"{/if}>Yes
		<input class="radio" name="fc_user_list" id="u_list_1" value="0" type="radio" {if $settings.fc_user_list==0}checked="checked"{/if}> No
	</div>
	<div class="clear"></div>
</div>

<div class="table_header">
	Advanced Settings
</div>
<div class="table" id='client_size'>
	<div class="table_left">
		<b>Chat Client Size:</b>
	</div>
	<div class="table_right">
		<div>
			<input name="fc_fullscreen" id="c_size_0" value="0" type="radio" {if $settings.fc_fullscreen ==0}checked="checked"{/if}>&nbsp;
			Width: <input name="fc_client_width" id="c_flash_width" size="5" value="{$settings.fc_client_width}" onKeyUp="value=value.replace(/\\D+/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\\D+/g,''))" />
				&nbsp;&nbsp;&nbsp;&nbsp;
			Height: <input name="fc_client_height" id="c_flash_height" size="5" value="{$settings.fc_client_height}" onKeyUp="value=value.replace(/\\D+/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\\D+/g,''))" />
		</div>
		<div id="f_screen" >
			<input name="fc_fullscreen" id="c_size_1" value="1" type="radio" {if $settings.fc_fullscreen==1}checked="checked"{/if}>&nbsp;&nbsp;Full Screen
		</div>
	</div>
	<div class="clear"></div>
</div>

<div class="table" id='language'>
	<div class="table_left">
		<b>Choose Language:</b>
	</div>
	<div class="table_right" id='choose_language'>
		<div id="u_al" {if $settings.fc_extendserver==2}style="display: none"{/if}>Note: You can set the language in 123FlashChat Admin Panel -> Client Settings -> Languages </div>
                <div id="set_lang" {if $settings.fc_extendserver!=2}style="display: none"{/if}>
                <select name="fc_client_lang">
                <option value="*"      {if $settings.language=='*'}selected="selected"{/if}>Auto detect</option>
                <option value="en"     {if $settings.language=='en'}selected="selected"{/if}>English</option>
                <option value="zh-CN"  {if $settings.language=='zh-CN'}selected="selected"{/if}>GB Chinese</option>
                <option value="zh-TW"  {if $settings.language=='zh-TW'}selected="selected"{/if}>Big5 Chinese</option>
                <option value="fr"     {if $settings.language=='fr'}selected="selected"{/if}>French</option>
                <option value="it"     {if $settings.language=='it'}selected="selected"{/if}>Italian</option>
                <option value="de"     {if $settings.language=='de'}selected="selected"{/if}>German</option>
                <option value="nl"	   {if $settings.language=='nl'}selected="selected"{/if}>Dutch</option>
                <option value="hu"     {if $settings.language=='hu'}selected="selected"{/if}>Hungarian</option>
                <option value="es"     {if $settings.language=='es'}selected="selected"{/if}>Spanish</option>
                <option value="hr"     {if $settings.language=='hr'}selected="selected"{/if}>Croatian</option>
                <option value="tr"     {if $settings.language=='tr'}selected="selected"{/if}>Turkish</option>
                <option value="ar"     {if $settings.language=='ar'}selected="selected"{/if}>Arabic</option>
                <option value="pt"     {if $settings.language=='pt'}selected="selected"{/if}>Portuguese</option>
                <option value="ru"     {if $settings.language=='ru'}selected="selected"{/if}>Russian</option>
                <option value="ko"     {if $settings.language=='ko'}selected="selected"{/if}>Korean</option>
            	<option value="serbian"  {if $settings.language=='serbian'}selected="selected"{/if}>Serbian</option>
                <option value="no"     {if $settings.language=='no'}selected="selected"{/if}>Norwegian</option>
                <option value="ja"     {if $settings.language=='ja'}selected="selected"{/if}>Japanese</option>
		</select>
                </div>
	</div>
	<div class="clear"></div>
</div>

<div class="table" id="skin">
	<div class="table_left">
        <b>Choose Skin:</b>
    </div>
    <div class="table_right">
		<div id="u_as" {if $settings.fc_extendserver==2}style="display: none"{/if}>Note: You can set the skin in 123FlashChat Admin Panel -> Client Settings -> Skin </div>
		<div id="skin_free" {if $settings.fc_extendserver!=2}style="display: none"{/if}>
	    	<table id="choose_skin" cellspacing="8" style="border:none;">
			<tr>
				<td title="default" bgcolor="#b7cde5" height="15" width="50"></td>
				<td title="green" bgcolor="#99cc67" width="50"></td>
				<td title="orange" bgcolor="#ffff00" width="50"></td>
			</tr>
			<tr>
				<td title="red" bgcolor="#ff0000" height="15"></td>
				<td title="black" bgcolor="#000000"></td>
				<td title="beige" bgcolor="#897f6f"></td>
			</tr>
			<tr>
				<td title="standard" bgcolor="#66ffff" height="15"></td>
				<td title="clean" bgcolor="#9999ff"></td>
				<td title="artistic" bgcolor="#cc6600"></td>
			</tr>
			</table>

			&nbsp;&nbsp;<img src="{$server_name}fc_{$settings.fc_client_skin}.gif" id="standardchat1">
		</div>
    </div>
    <input name="fc_client_skin" id="c_skin" value="{$settings.fc_client_skin}" type="hidden">
</div>

<div class="table_bottom">
	<input type="submit" name="update" value="submit" class="button" />
</div>

</form>
<input id="server_name" value="{$server_name}" type="hidden"></input>

<script type="text/javascript">
<!--
{literal}

var TblCells=document.getElementById("choose_skin").getElementsByTagName("td");
for (var t=0,curCell; curCell=TblCells[t]; t++)
curCell.onclick = function()
{
    if (this.getAttribute('title'))
    {
        document.getElementById('standardchat1').src =  document.getElementById('server_name').value + 'fc_' + this.getAttribute('title')  +'.gif';
        document.getElementById('c_skin').value = this.getAttribute('title');
    }
}

function showHide(id, sh)
{
	var e = document.getElementById(id);
	e.style.display = (sh == 1) ? 'block' : 'none';
}

function onclick_server_mode(id,c_loc)
{
	if (id == 0)
	{
		if (c_loc == 0)
		{
			showHide('chat_port',0);
			showHide('chat_host',0);
			showHide('http_port',0);
			showHide('s_download',0);
		}
		else
		{
			showHide('chat_port',1);
			showHide('chat_host',1);
			showHide('http_port',1);
			showHide('s_download',1);
		}
		showHide('login_chat',1);
		showHide('client_location',1);
		showHide('room_name',0);
        showHide('u_as',1);
        showHide('skin_free',0);
        showHide('u_al',1);
        showHide('set_lang',-1);
		document.getElementById('room_list').style.display = '';
	}
	else if (id == 1)
	{
		showHide('chat_port',0);
		showHide('chat_host',0);
		showHide('http_port',0);
		showHide('client_location',1);
		showHide('room_name',0);
		showHide('login_chat',1);
		showHide('s_download',0);
                showHide('u_as',1);
                showHide('skin_free',0);
                showHide('u_al',1);
                showHide('set_lang',-1);
			document.getElementById('room_list').style.display = '';
	}
	else
	{
            showHide('u_as',0);
            showHide('skin_free',1);
                showHide('u_al',0);
		showHide('s_download',0);
		showHide('chat_port',0);
		showHide('chat_host',0);
		showHide('http_port',0);
		showHide('client_location',0);
		showHide('room_name',1);
		showHide('login_chat',0);
        showHide('u_al',0);
        showHide('u_as',0);
        showHide('set_lang',1);
		document.getElementById('room_list').style.display = 'none';
		document.getElementById('c_flash_width').style.display = '';
	}
}

function onclick_chat_status(id)
{
	if (id == 1)
	{
		if (document.getElementById('s_mode_2').checked)
		{
			document.getElementById('room_list').style.display = 'none';
		}
		else
		{
			document.getElementById('room_list').style.display = '';
		}
		document.getElementById('user_list').style.display = '';
	}
	else
	{
		document.getElementById('room_list').style.display = 'none';
		document.getElementById('user_list').style.display = 'none';
	}
}

{/literal}
-->
</script>